package org.lsp.opencvauto;



import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.net.URL;


@SpringBootApplication
public class OpencvautoApplication {


    private static final Logger log = LoggerFactory.getLogger(OpencvautoApplication.class);

    static {
        // 解决awt报错问题
        System.setProperty("java.awt.headless", "false");
        // 加载动态库
        URL url = ClassLoader.getSystemResource("lib/opencv/opencv_java480.dll");
        System.load(url.getPath());


    }

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(OpencvautoApplication.class, args);
        Start start = context.getBean(Start.class); // 从 Spring 容器获取实例
        start.startRun(); // 调用方法
    }

}
